package com.servlet;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import java.io.IOException;

/**
 * @author WZ
 * @version 1.0
 * @date 2021/9/2 11:47
 */
@Slf4j
public class MyFilter implements Filter {
	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
		log.info("MyFilter初始化完成");
	}

	@Override
	public void destroy() {
		log.info("MyFilter销毁");

	}

	@Override
	public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
		log.info("MyFileter工作");
		filterChain.doFilter(servletRequest,servletResponse);
	}
}
